package com.nulldev.util.web.nTube.pages.misc;

import java.util.Map;

import com.nulldev.util.data.Arrays.maps.FastMaps;

public interface IBrowserSpecificWorkarounds {

	/**
	 * Browser lacks ::cue support.
	 */
	public static final int BROWSER_WORKAROUND_DISABLE_STYLING = 0x00000001;
	/**
	 * Browser will refuse to accept subtitles with a position.
	 */
	public static final int BROWSER_WORKAROUND_DISABLE_POSITIONING = 0x00000002;
	/**
	 * Browser will refuse to accept subtitles with 3 digit timestamp precision.
	 */
	public static final int BROWSER_WORKAROUND_REQUIRE_LESS_TIMESTAMP_PRECISION = 0x00000004;

	public static final Map<String, Integer> WORKAROUNDS = FastMaps.fixedUniMap(new Object[][]
		{
				/* I don't think anyone will be running (or can run) nTube on IE 10... */
				{ "compatible; MSIE 10.0;",
						BROWSER_WORKAROUND_DISABLE_POSITIONING | BROWSER_WORKAROUND_DISABLE_STYLING | BROWSER_WORKAROUND_REQUIRE_LESS_TIMESTAMP_PRECISION },
				{ "Trident/7.0; rv:11.0",
						BROWSER_WORKAROUND_DISABLE_POSITIONING | BROWSER_WORKAROUND_DISABLE_STYLING | BROWSER_WORKAROUND_REQUIRE_LESS_TIMESTAMP_PRECISION },
				{ "Opera/9.80", BROWSER_WORKAROUND_DISABLE_POSITIONING | BROWSER_WORKAROUND_DISABLE_STYLING },
				{ "(BB10; Kbd)", BROWSER_WORKAROUND_DISABLE_STYLING } });
}
